package com.oss.intercept.sys;

import com.eova.aop.AopContext;
import com.eova.aop.MetaObjectIntercept;
import com.jfinal.plugin.activerecord.Record;

public class SysRoleIntercept extends MetaObjectIntercept {

    @Override
    public String deleteBefore(AopContext ac) throws Exception {
        Record r = ac.record;

        Integer id = r.getInt("id");

        if (id == 5 || id == 6 || id == 7) {
            return "业务需要，不能删除这个角色";
        }

        return super.deleteBefore(ac);
    }
}
